package com.demo.dao;

import com.demo.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;


public interface UserDao extends JpaRepository<User, String>, JpaSpecificationExecutor<User> {
    @Query(value = "select *  from tb_user  where  id=?1", nativeQuery = true)
    User queryById(Integer id);

    @Modifying
    @Query(value = "ALTER TABLE   tb_user  AUTO_INCREMENT=?1", nativeQuery = true)
    void updateAutoIncrement(int i);
}
